package cn.com.jslh.boarpro.main.model;

import android.content.Context;

import java.util.List;

import cn.com.jslh.boarpro.base.mvp.BaseListModel;
import cn.com.jslh.boarpro.tables.WeanTable;
import cn.com.jslh.boarpro.util.database.DataBaseUtil;

/**
 * 作者：周洲 on 2017/7/28 10:41
 * <p>
 * 邮箱：double0zhou@126.com
 */

public class AddDeliveryRecordModelImpl extends BaseListModel {


    public AddDeliveryRecordModelImpl(Context context) {
        super(context);
    }

    @Override
    public List<?> getDatas(String... params) {
        return null;
    }


    /**
     * 记录存入数据库
     * @param params
     */
    public void save2Db(String... params){

        //    "muZhuID": "kvYAAAgGbu/ECiku",--母猪ID 0
//    "pigletQty": 2,--种苗数01
//    "jianZaiQty": 10,--健仔数02
//    "ruoZaiQty": 3,--弱仔数3
//    "siTaiQty": 1,--死淘数4
//    "jiZaiQty": 0,--畸仔数--如果为空，传过来05
//    "muNaiYiQty":1,--木乃伊数6
//    "woWt":105.55--窝重7
        WeanTable weanTable = new WeanTable();
        weanTable.setMuZhuID(params[0]);
        weanTable.setPigletQty(Integer.parseInt(params[1]));
        weanTable.setJianZaiQty(Integer.parseInt(params[2]));
        weanTable.setRuoZaiQty(Integer.parseInt(params[3]));
        weanTable.setSiTaiQty(Integer.parseInt(params[4]));
        weanTable.setJiZaiQty(Integer.parseInt(params[5]));
        weanTable.setMuNaiYiQty(Integer.parseInt(params[6]));
        weanTable.setWoWt(Double.valueOf(params[7]));
        weanTable.setErHao(params[8]);
        weanTable.setZhuSheId(DeliveryRecordModelImpl.zhusheid);
        DataBaseUtil.saveObjectData(context,WeanTable.class,weanTable);
    }
}
